<?php
session_start();
require dirname(__FILE__) . "/../classes/imageClass.php";
require dirname(__FILE__) . "/../classes/albumClass.php";
require dirname(__FILE__) . "/../classes/connectionFactoryClass.php";
require dirname(__FILE__) . "/../classes/imageDao.php";
require dirname(__FILE__) . "/../classes/albumDao.php";


$iduser=$_SESSION['userId'];
$image= new ImageClass();
$album = new albumClass();
$c = new ConnectionFactory();
$db = $c->getConnection();
$imageDao = new imageDao($db);
$albumDao = new albumDao($db);

echo'<pre>';
$idPhoto = $_GET['id'];
$foto = $imageDao->getById($idPhoto);
$alb=$albumDao->getAlbuns($iduser,$foto->getAlbumId());


$dir=$alb[0]->getDirectory().$alb[0]->getNameAlbum().'/'.$foto->getName_photo();

//echo "<img src='$dir'
//width=500 height=500 border=5 cernter=1 />";
//header('Localização: /../visualizePhoto.php');
?>
